﻿using System;
using System.Drawing;
using MathNet.Numerics.LinearAlgebra;

namespace GridRayTracer.Primitives
{
  [Serializable]
  public class SpotLight : Light
  {
    public SpotLight()
    {
      Attenuation = 0.01;
    }
    
    public override Color GetColorAt(Vector point) 
    {
      return Color.Scale(Math.Exp(-Attenuation * (point - Location).SquaredNorm()));
    }
    
    public double Attenuation
    {
      get;
      set;
    }
  }
}
